package com.security.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.security.entity.User;
import com.security.mapper.UserMapper;
import com.security.service.IUserService;
import com.security.util.DigestUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author cici
 */
@Service
@Slf4j
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Override
    public User createUser(User user) {
        user.setPassword(DigestUtil.encrypt(user.getPassword()));
        log.info("1111111111");
        baseMapper.insert(user);
        return baseMapper.selectById(user.getId());
    }

}
